const isDef = val => val !== undefined;

function merge (from, to) {
    if(Object.prototype.toString.call(from) === '[object Object]') {
        Object.keys(to).forEach(key => {
            if(isDef(from[key])) {
                to[key] = from[key]
            }
        })
    }
    return to
}

export { isDef, merge }